Optimal. Leaf size=83 \[ \frac {a B \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {b B x}{a^2+b^2}-\frac {a^3 B \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}+\frac {B \tan (c+d x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {21, 3566, 3626, 3617, 31, 3475} \[ -\frac {a^3 B \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}+\frac {a B \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {b B x}{a^2+b^2}+\frac {B \tan (c+d x)}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 31
Rule 3475
Rule 3566
Rule 3617
Rule 3626
Rubi steps
\begin {align*} \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx &=B \int \frac {\tan ^3(c+d x)}{a+b \tan (c+d x)} \, dx\\ &=\frac {B \tan (c+d x)}{b d}+\frac {B \int \frac {-a-b \tan (c+d x)-a \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b}\\ &=-\frac {b B x}{a^2+b^2}+\frac {B \tan (c+d x)}{b d}-\frac {(a B) \int \tan (c+d x) \, dx}{a^2+b^2}-\frac {\left (a^3 B\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )}\\ &=-\frac {b B x}{a^2+b^2}+\frac {a B \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d}-\frac {\left (a^3 B\right ) \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^2 \left (a^2+b^2\right ) d}\\ &=-\frac {b B x}{a^2+b^2}+\frac {a B \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a^3 B \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.42, size = 92, normalized size = 1.11 \[ -\frac {B \left (\frac {2 a^3 \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right )}+\frac {\log (-\tan (c+d x)+i)}{a+i b}+\frac {\log (\tan (c+d x)+i)}{a-i b}-\frac {2 \tan (c+d x)}{b}\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.54, size = 119, normalized size = 1.43 \[ -\frac {2 \, B b^{3} d x + B a^{3} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - {\left (B a^{3} + B a b^{2}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 2 \, {\left (B a^{2} b + B b^{3}\right )} \tan \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.88, size = 90, normalized size = 1.08 \[ -\frac {\frac {2 \, B a^{3} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac {B a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, B \tan \left (d x + c\right )}{b}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.24, size = 98, normalized size = 1.18 \[ \frac {B \tan \left (d x +c \right )}{b d}-\frac {a^{3} B \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right ) d}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a B}{2 d \left (a^{2}+b^{2}\right )}-\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b}{d \left (a^{2}+b^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.57, size = 89, normalized size = 1.07 \[ -\frac {\frac {2 \, B a^{3} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac {B a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, B \tan \left (d x + c\right )}{b}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.37, size = 98, normalized size = 1.18 \[ \frac {B\,\mathrm {tan}\left (c+d\,x\right )}{b\,d}-\frac {B\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (a-b\,1{}\mathrm {i}\right )}-\frac {B\,a^3\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{b^2\,d\,\left (a^2+b^2\right )}-\frac {B\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (-b+a\,1{}\mathrm {i}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 2.14, size = 660, normalized size = 7.95 \[ \begin {cases} \tilde {\infty } B x \tan ^{2}{\relax (c )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {3 B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {3 i B d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {i B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )} \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {2 B \tan ^{2}{\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {2 i B \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {5 B}{2 b d \tan {\left (c + d x \right )} - 2 i b d} & \text {for}\: a = - i b \\- \frac {3 B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {3 i B d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {i B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )} \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {2 B \tan ^{2}{\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {2 i B \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {5 B}{2 b d \tan {\left (c + d x \right )} + 2 i b d} & \text {for}\: a = i b \\\frac {B \left (- \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {\tan ^{2}{\left (c + d x \right )}}{2 d}\right )}{a} & \text {for}\: b = 0 \\\frac {x \left (B a + B b \tan {\relax (c )}\right ) \tan ^{3}{\relax (c )}}{\left (a + b \tan {\relax (c )}\right )^{2}} & \text {for}\: d = 0 \\- \frac {2 B a^{3} \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} + \frac {2 B a^{2} b \tan {\left (c + d x \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} - \frac {B a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} - \frac {2 B b^{3} d x}{2 a^{2} b^{2} d + 2 b^{4} d} + \frac {2 B b^{3} \tan {\left (c + d x \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________